﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Unity.AutoRegistration;
using TraceInspector.ViewModel;
using TraceInspector.Application;


namespace TraceInspector.UI.WPF
{
    public class BootStrapper
    {
        IUnityContainer _container;

        public MainWindowViewModel MainWindowViewModel
        {
            get
            {
               return _container.Resolve<MainWindowViewModel>();
            }
        }
        

        public IUnityContainer Container
        {
            get { return _container; }
            set { _container = value; }
        }


        public BootStrapper()
        {
            _container = new UnityContainer();
            _container.RegisterType<IUIDataProvider, UIDataProvider>(new ContainerControlledLifetimeManager());
            _container.RegisterType<IToolManager, ToolManager>(new ContainerControlledLifetimeManager());
            _container.RegisterType<MainWindowViewModel>(new ContainerControlledLifetimeManager());
        }
    }
}
